<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  template="/WEB-INF/facelets/email/template_email.xhtml">

  <ui:param name="toName" value="#{emailServiceImpl.toName}"/>
  <ui:param name="toEmailAddr" value="#{emailServiceImpl.toEmailAddr}"/>
  <ui:param name="replyToName" value="#{sendEmail.fromName}"/>
  <ui:param name="replyToEmail" value="#{sendEmail.replyEmail}"/>
  <ui:param name="subject"
    value="#{msgs.format('jsf.email.JoinGroupRequest.Subject',
              versionGroupJoinAction.groupName)}"/>

  <ui:define name="body">
    <p>#{msgs['jsf.email.maintainer.DearMaintainer']}</p>

    <p>#{msgs.format('jsf.email.joingrouprequest.RequestingToJoinGroup',
      sendEmail.fromName, sendEmail.fromLoginName, versionGroupJoinAction.groupName)}</p>
    <ul class="list--slat">
      <ui:repeat value="#{versionGroupJoinAction.projectVersions}"
        var="version">
        <s:fragment rendered="#{version.selected}">
          <li>
            #{msgs['jsf.Project']}:#{version.projectIteration.project.slug} - #{msgs['jsf.Version']}:#{version.projectIteration.slug}
          </li>
        </s:fragment>
      </ui:repeat>
    </ul>
    <s:fragment rendered="#{not empty sendEmail.htmlMessage}">
      <p>#{msgs.format('jsf.email.UserMessageIntro', sendEmail.fromName)}</p>
      <hr/>
      <h:outputText value="#{sendEmail.htmlMessage}" escape="false"/>
      <hr/>
    </s:fragment>

    <p>#{msgs.format('jsf.email.JoinGroupRequest.ResponseInstructions',
      sendEmail.fromName, sendEmail.replyEmail)}</p>

    <p>
      <a
        href="#{applicationConfiguration.serverPath}/version-group/view/#{versionGroupJoinAction.slug}#settings-projects">
        #{applicationConfiguration.serverPath}/version-group/view/#{versionGroupJoinAction.slug}#settings-projects
      </a>
    </p>
  </ui:define>

</ui:composition>
